import { NavbarIconInfo } from "../view/mainUI/navbar/NavbarIconInfo";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class MainUINavbarConfig
    
    export  class MainUINavbarConfig
    {
        constructor()
        {
            
            this.initConfig();
            return;
        }

        public MainUINavbarConfig.get data(): Map<any, any> /* flash.utils.Dictionary */
        {
            return this._data;
        }

        public getInfoById(arg1: int): NavbarIconInfo
        {
            return this._data[arg1];
        }

        public getInfoByJudge(arg1: Array<any>, arg2: Array<any>): Array<any>
        {
            var loc2=null;
            var loc3=false;
            var loc4=0;
            var loc5=null;
            var loc6=null;
            var loc7=null;
            var loc8=0;
            var loc1=[];
            var loc9=0;
            var loc10=this._data;
            for(loc2 of loc10) 
            {
                loc3 = true;
                loc4 = 0;
                while (loc4 < arg1.length) 
                {
                    if ((loc5 = arg1[loc4] as string) != "taskCodes") 
                    {
                        if (loc2[loc5] != arg2[loc4]) 
                        {
                            loc3 = false;
                            break;
                        }
                    }
                    else 
                    {
                        loc6 = arg2[loc4] as string;
                        if ((loc8 = (loc7 = loc2["taskCodes"] as string).indexOf(loc6)) < 0) 
                        {
                            loc3 = false;
                            break;
                        }
                    }
                    ++loc4;
                }
                if (!loc3) 
                {
                    continue;
                }
                loc1.push(loc2);
            }
            return loc1;
        }

        /* internal  */initConfig(): void
        {
            var loc2=null;
            var loc3=null;
            this._data = new Map<any, any> /* flash.utils.Dictionary */();
            var loc1=ConfigManager.instance.getJSONByFileName("uiByLevel.json");
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                loc3 = new NavbarIconInfo();
                this.copyValue(loc3, loc2);
                this._data[loc3.id] = loc3;
            }
            return;
        }

        /* internal  */copyValue(arg1: Object, arg2: Object): void
        {
            var loc1=null;
            var loc2=0;
            var loc3=arg2;
            for (loc1 in loc3) 
            {
                arg1[loc1] = arg2[loc1];
            }
            return;
        }

        public static get instance(): MainUINavbarConfig
        {
            if (MainUINavbarConfig._instance == null) 
            {
                MainUINavbarConfig._instance = new MainUINavbarConfig();
            }
            return MainUINavbarConfig._instance;
        }

        /* internal */ /* var */_data: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: MainUINavbarConfig;
    }
